require.config({
    baseUrl:"./",
    paths:{
        jq:"../libs/jquery",
        getGoods:"../modules/getGoods",
        setLocal:"../modules/setLocal"
    }
})
require(["jq","getGoods","setLocal"],function(_,getGoods,setLocal){
    const url = "http://localhost:3000/api"
    // const cont = $(".cartshow")
    const bboss = $(".bboss")
// 1.请求数据
    getGoods(url,res=>{
        res = JSON.parse(res).msg;
})
// 2.绑定事件
bboss.on("click",".add",function(){
    const id = $(this).parent().attr("index")
    const price = $(this).prev().children( "p:last-child").children().html();
    console.log(price)
// 4.将点击商品信息存入本地存储
    setLocal(id,price)
})
})